package com.yang.bean.util;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;

import java.io.InputStream;

/**
 * @Description: 把流转为document
 * @author: Yang Qiang
 * @create: 2021-11-08 21:43
 */
public class DocumentReader {
    public static Document createDocument(InputStream inputStream) {
        SAXReader saxReader = new SAXReader();

        Document document = null;

        try {
            document = saxReader.read(inputStream);
        } catch (DocumentException e) {
            e.printStackTrace();
        }


        return document;
    }
}
